package com.neu.view;

import android.app.Application;
import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;

public class App extends Application {
    public static Context context;
    //volley 队列
    public static RequestQueue sRequsetQueue;


    @Override
    public void onCreate() {
        super.onCreate();
        context=getApplicationContext();
        sRequsetQueue= getRequestQueue(context);

    }

    //创建volley队列
    public static RequestQueue getRequestQueue(Context context){
        if (sRequsetQueue==null){
            synchronized(RequestQueue.class) {
                sRequsetQueue = Volley.newRequestQueue(context);
            }
        }
        return  sRequsetQueue;
    }
}
